﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Xml.Serialization;

namespace BDSim
{
    /// <summary>
    /// 环境段模型类型的枚举类型
    /// </summary>
    public enum EnvModelType
    {
        SpaceEnv,
        ClimateSim,
        IonTECSim,
        AstronomyEnv,
        AstroMotion,
        EarthAutoTurn,
        GeographyEnv,
    }

    /// <summary>
    /// 电离层仿真模型类型
    /// </summary>
    public enum IonSimModelType
    {
        球谐模型 ,//= 1
        全球格网插值模型// = 2,
    }

    /// <summary>
    /// 气象参数输入结构体
    /// </summary>
    public struct ClimateParaInput
    {
        public UTCTime time;	//对应的时间
        public double Lat;		//纬度
        public double High;	    //高度
    }

    /// <summary>
    /// 极移
    /// </summary>
    public struct PoleMotion
    {
        public double x;
        public double y;
    }    

    /// <summary>
    /// EOP文件信息
    /// </summary>
    public struct EopFileInfo
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
        public char[] startTime;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
        public char[] endTime;
        public int lineNum;
    }

    /// <summary>
    /// EphDat文件信息
    /// </summary>
    public struct EphDatFileInfo
    {
        public double startTime;
        public double endTime;
        public int lineNum;
    };

    /// <summary>
    /// 电离层格网数据基础结构
    /// </summary>
    public struct IonGridData
    {
        public UTCTime time;	//对应的时间
        public double Lat;		//纬度
        public double Lon;		//经度
        public double VTEC;	    //该经纬度time时间天顶方向电离层电子量
    }

    /// <summary>
    /// 大地坐标系表示的地固坐标系间隔
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class IntervalBLHClass
    {
        private double b = 5.0;
        [XmlAttribute, DescriptionAttribute("纬度间隔，单位(度)，默认：5度"), PropertyOrder(1)]
        public double B
        {
            get { return b; }
            set { b = value; }
        }

        private double l = 10.0;
        [XmlAttribute, DescriptionAttribute("经度间隔，单位(度)，默认10度"), PropertyOrder(2)]
        public double L
        {
            get { return l; }
            set { l = value; }
        }

        private double h = 1000.0;
        [XmlAttribute, DescriptionAttribute("高度间隔，单位(米)，默认1000米"), PropertyOrder(3)]
        public double H
        {
            get { return h; }
            set { h = value; }
        }

        public override string ToString()
        {
            return B.ToString() + ", " + L.ToString() + ", " + H.ToString();
        }
    }
}
